home *** CD-ROM | disk | FTP | other *** search
/ Champak 99 / (Vol 99) Jan 19 2010.iso / Games / arkanoid.swf / scripts / frame_16 / DoAction.as
Text File  |  2010-01-19  |  1KB  |  45 lines

  1. i = 1;
  2. while(noOfE >= i)
  3. {
  4.    expand_y = getProperty("expand" add i, _Y);
  5.    expand_y += 6;
  6.    setProperty("expand" add i, _Y, expand_y);
  7.    if(expand_y > 390)
  8.    {
  9.       bat_x = getProperty("/bat", _X);
  10.       bat_left = bat_x - batWidth / 2;
  11.       bat_right = bat_x + batWidth / 2;
  12.       expand_x = getProperty("expand" add i, _X);
  13.       expand_left = expand_x - 10;
  14.       expand_right = expand_x + 10;
  15.       if(expand_left >= bat_left && bat_right >= expand_right)
  16.       {
  17.          tellTarget("/soundFX")
  18.          {
  19.             gotoAndStop("Expand");
  20.             play();
  21.          }
  22.          trace("You\'ve just got EXPAND");
  23.          if(expanded == 0)
  24.          {
  25.             expanded = 1;
  26.             setProperty("/bat", _xscale, 100);
  27.             batWidth = 80;
  28.             stopDrag();
  29.             startDrag("/bat",1,50,400,370,400);
  30.             power_up = "expand";
  31.             shrunken = 0;
  32.             call("reset_capsules");
  33.          }
  34.          removeMovieClip("expand" add i);
  35.          onscreen_E = 0;
  36.       }
  37.       else
  38.       {
  39.          removeMovieClip("expand" add i);
  40.          onscreen_E = 0;
  41.       }
  42.    }
  43.    i += 1;
  44. }
  45.